using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Terra.WebApi.Areas.Mobile.Controllers
{
    /// <summary>
    /// 移动端首页控制器
    /// </summary>
    [Area("Mobile")]
    [Route("api/mobile/[controller]")]
    [ApiController]
    [Authorize]
    public class HomeController : ControllerBase
    {
        /// <summary>
        /// 获取移动端首页信息
        /// </summary>
        /// <returns>首页数据</returns>
        [HttpGet]
        public IActionResult Get()
        {
            return Ok(new
            {
                message = "这是移动端接口",
                platform = "Mobile",
                version = "1.0.0"
            });
        }

        /// <summary>
        /// 获取移动端配置信息
        /// </summary>
        /// <returns>配置信息</returns>
        [HttpGet("config")]
        public IActionResult GetConfig()
        {
            return Ok(new
            {
                appVersion = "1.0.0",
                apiVersion = "v1",
                updateRequired = false,
                minVersion = "1.0.0",
                features = new[]
                {
                    "push_notification",
                    "offline_mode",
                    "biometric_auth"
                }
            });
        }
    }
}